how to validate a form using regular expression